<%@ Assembly Name="Noftware.SPArchiveTweets, Version=0.9.0.0, Culture=neutral, PublicKeyToken=3cb7ac27e0be6ed2" %>

<%@ Page Language="C#" Inherits="Noftware.SPArchiveTweets.ManageJob" MasterPageFile="~/_admin/admin.master" %>

<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="AdminControls" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint.ApplicationPages.Administration" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="~/_controltemplates/ButtonSection.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral ID="EncodedLiteral1" runat="server" Text="Manage Archive Tweets Timer"
        EncodeMethod='HtmlEncode' />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
    runat="server">
    <SharePoint:EncodedLiteral ID="EncodedLiteral2" runat="server" Text="Manage Archive Tweets Timer"
        EncodeMethod="HtmlEncode" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderPageDescription" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <SharePoint:ScriptLink ID="jsSPArchiveTweetsDialog" runat="server" Name="/SPArchiveTweets/dialog.js" LoadAfterUI="false" OnDemand="false" Localizable="false" />
    <SharePoint:ScriptLink ID="jsSPArchiveTweets" runat="server" Name="/SPArchiveTweets/SPArchiveTweets.js" LoadAfterUI="false" OnDemand="false" Localizable="false" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
        <tr valign="top">
        <td id="tdMaintenance" runat="server" visible="false"><asp:HyperLink ID="lnkMaintenancePage" runat="server" Text="Maintenance" NavigateUrl="Maintenance.aspx" ToolTip="Allows deletion of all lists and data" /></td>
        <td id="tdOpenSourceList" runat="server" visible="false"></td>
        </tr>
    </table>
    <asp:Literal ID="HoursBetweenIntervals" Text="2" runat="server" Visible="false" />
    <asp:Label ID="lblMessages" runat="server" CssClass="ms-error" />
    <table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
        <tr>
            <td>
                <wssuc:InputFormSection Title="SharePoint Site" runat="server">
                    <template_description>
						<SharePoint:EncodedLiteral ID="ltlSPSiteDesc" runat="server" text="Specify the fully qualified URL of the SharePoint site where the Tweet lists will be created and populated with Twitter data." EncodeMethod="NoEncode"/>
					</template_description>
                    <template_inputformcontrols>
						<wssuc:InputFormControl runat="server" LabelText="SharePoint site URL:">
							<Template_control>
								<SharePoint:InputFormTextBox ID="txtSharePointSiteUrl" Columns="35" runat="server" /><br />
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="SharePoint Site URL is required." ID="reqSharePointSiteUrl" controltovalidate="txtSharePointSiteUrl" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>						
						<wssuc:InputFormControl runat="server">
							<Template_control>
								<asp:LinkButton ID="btnTestUrl" CssClass="ms-cui-ctl-medium" Text="Test URL" runat="server" OnClick="btnTestUrl_Click" />
                                &nbsp;
                                <asp:LinkButton ID="btnCreateLists" CssClass="ms-cui-ctl-medium" Text="Create Lists" runat="server" OnClick="btnCreateLists_Click" />
                                &nbsp;
                                <asp:HyperLink ID="lnkSourceModify" CssClass="ms-cui-ctl-medium" runat="server" Text="Manage Twitter accounts" ToolTip="Manage the Twitter acount list" />
							</Template_control>
						</wssuc:InputFormControl>
					</template_inputformcontrols>
                </wssuc:InputFormSection>
            </td>
        </tr>
        <tr>
            <td>
                <!-- Schedule -->
                <wssuc:InputFormSection Title="Schedule" runat="server">
                    <template_description>
						<SharePoint:EncodedLiteral ID="ltlScheduleDesc" runat="server" text="Set the frequency for running the timer job." EncodeMethod='HtmlEncodeAllowSimpleTextFormatting'/>
					</template_description>
                    <template_inputformcontrols>
					  <wssuc:InputFormControl runat="server" LabelText="Frequency">
						<Template_control>
						<div>
						  <asp:DropDownList id="ddlSchedule" name="ddlSchedule" runat="server" Width="250" AutoPostBack="true">
							<asp:ListItem Text="None" Value="" Selected="True" />      
							<asp:ListItem Text="Immediate" Value="Immediate" />
							<asp:ListItem Text="Daily" Value="Daily" />
						  </asp:DropDownList>
						  </div>
							<asp:Label ID="lblManualMessage"  runat="server" Text="Warning: If you run in 'Immediate' mode, any existing scheduled timer jobs will be deleted." Visible="false" CssClass="ms-error" />
						  <asp:PlaceHolder ID="phdScheduleTime" runat="server" Visible="false">
							<br /><span>Times to run:</span><br />
							<asp:Repeater ID="repPickerControls" runat="server">
								<HeaderTemplate>
									<table border="0" cellpadding="0" cellspacing="0">
								</HeaderTemplate>
								<ItemTemplate>
									<tr valign="middle" style="padding-top: 3px;">
										<td>
											<asp:Literal ID="ltlIndex" runat="server" />.&nbsp;
										</td>
										<td>
											<asp:DropDownList ID="ddlHour" runat="server">
												<asp:ListItem Text="00:" Value="0" />
												<asp:ListItem Text="06:" Value="6" />
												<asp:ListItem Text="12:" Value="12" />
												<asp:ListItem Text="18:" Value="18" />
											</asp:DropDownList>
										</td>
										<td>
											<asp:checkbox text="Enabled" runat="server" ID="chkScheduleEnabled" Checked="false" />
										</td>
									</tr>
								</ItemTemplate>
								<FooterTemplate>
									</table>
	<br />
	<span><u>Note</u><br />
		&#187;&nbsp;Each timer job can start anytime between your defined start time up to
		15 minutes later.</span> </FooterTemplate> </asp:Repeater> </asp:PlaceHolder>
	</Template_control> </wssuc:InputFormControl> </template_inputformcontrols>
                </wssuc:InputFormSection>
            </td>
        </tr>
        <tr>
            <td>
                <wssuc:InputFormSection Title="Twitter OAuth" runat="server">
                    <template_description>
						<SharePoint:EncodedLiteral ID="ltlOAuthDesc" runat="server" text="Twitter's authentication settings via OAuth. Sign-up for a <a href='http://dev.twitter.com/' target='_blank'>Twitter developer account</a> and register an application to receive the four OAuth keys." EncodeMethod="NoEncode"/>
					</template_description>
                    <template_inputformcontrols>
						<wssuc:InputFormControl runat="server" LabelText="Consumer Key:">
							<Template_control>
								<SharePoint:InputFormTextBox ID="txtOAuthConsumerKey" Columns="35" runat="server" /><br />
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Consumer Key is required." ID="reqOAuthConsumerKey" controltovalidate="txtOAuthConsumerKey" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>						
						<wssuc:InputFormControl runat="server" LabelText="Consumer Secret:">
							<Template_control>
								<SharePoint:InputFormTextBox ID="txtOAuthConsumerSecret" Columns="35" runat="server" /><br />
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Consumer Secret is required." ID="reqOAuthConsumerSecret" controltovalidate="txtOAuthConsumerSecret" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>
						<wssuc:InputFormControl runat="server" LabelText="Access Token:">
							<Template_control>
								<SharePoint:InputFormTextBox ID="txtOAuthAccessToken" Columns="35" runat="server" /><br />
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Access Token is required." ID="reqOAuthAccessToken" controltovalidate="txtOAuthAccessToken" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>
						<wssuc:InputFormControl runat="server" LabelText="Access Token Secret:">
							<Template_control>
								<SharePoint:InputFormTextBox ID="txtOAuthAccessTokenSecret" Columns="35" runat="server" /><br />
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Access Token Secret is required." ID="reqOAuthAccessTokenSecret" controltovalidate="txtOAuthAccessTokenSecret" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>
						<wssuc:InputFormControl runat="server">
							<Template_control>
								<asp:LinkButton ID="btnTestOAuth" CssClass="ms-cui-ctl-medium" Text="Test OAuth" runat="server" OnClick="btnTestOAuth_Click" />
							</Template_control>
						</wssuc:InputFormControl>
					</template_inputformcontrols>
                </wssuc:InputFormSection>
            </td>
        </tr>
        <tr>
            <td>
                <wssuc:InputFormSection Title="Twitter Timeline" runat="server">
                    <template_description>
						<SharePoint:EncodedLiteral ID="ltlTimelineDesc" runat="server" text="Twitter's timeline settings." EncodeMethod="HtmlEncodeAllowSimpleTextFormatting"/>
					</template_description>
                    <template_inputformcontrols>
						<wssuc:InputFormControl runat="server" LabelText="Include re-tweets:" ExampleText="(If 'Yes', re-tweets will be included in the timeline.)">
							<Template_control>
								<asp:DropDownList ID="ddlIncludeRetweets" runat="server">
									<asp:ListItem Value="true" Text="Yes" />
									<asp:ListItem Value="false" Text="No" />
								</asp:DropDownList>
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Please choose if re-tweets should be included in the timeline." ID="reqIncludeRetweets" controltovalidate="ddlIncludeRetweets" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>						
						<wssuc:InputFormControl runat="server" LabelText="Include entities:" ExampleText="(Entities are 'user mentions', 'URLs', 'Hashtags', etc.)">
							<Template_control>
								<asp:DropDownList ID="ddlIncludeEntities" runat="server">
									<asp:ListItem Value="true" Text="Yes" />
									<asp:ListItem Value="false" Text="No" />
								</asp:DropDownList>
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Please choose if entities should be included in the timeline." ID="reqIncludeEntities" controltovalidate="ddlIncludeEntities" runat="server" Display="Dynamic"/>
							</Template_control>
						</wssuc:InputFormControl>
						<wssuc:InputFormControl runat="server" LabelText="Maximum number of tweets to retrieve:">
							<Template_control>
								<SharePoint:InputFormTextBox ID="txtTweetCount" Columns="4" MaxLength="3" runat="server" />
								<wssawc:InputFormRequiredFieldValidator ValidationGroup="ArchiveTweets" ErrorMessage="Tweet number is required." ID="reqTweetCount" controltovalidate="txtTweetCount" runat="server" Display="Dynamic"/>
								<asp:CompareValidator ValidationGroup="ArchiveTweets" ControlToValidate="txtTweetCount" Operator="DataTypeCheck" Type="Integer" ErrorMessage="Value must be a whole number." runat="server" />
                                <asp:RangeValidator ValidationGroup="ArchiveTweets" ControlToValidate="txtTweetCount" Type="Integer" MaximumValue="200" MinimumValue="1" ErrorMessage="Enter a value between 1 and 200." runat="server" />
							</Template_control>
						</wssuc:InputFormControl>
					</template_inputformcontrols>
                </wssuc:InputFormSection>
            </td>
        </tr>
        <asp:PlaceHolder ID="phdExistingJobDelete" runat="server" Visible="false">
        <tr>
            <td>
                <wssuc:InputFormSection Title="Maintenance and Administration" runat="server">
                    <template_description>
						<SharePoint:EncodedLiteral ID="ltlAdminDesc" runat="server" text="Allows permanent deletion of all archived Twitter lists and data as well as the ability to administer the source of Twitter accounts." EncodeMethod="HtmlEncodeAllowSimpleTextFormatting"/>
					</template_description>
                    <template_inputformcontrols>
						<wssuc:InputFormControl runat="server" LabelText="Permanently delete Twitter lists and all tweet data:">
							<Template_control>
                                <asp:LinkButton CssClass="ms-cui-ctl-medium" runat="server" OnClientClick="return confirm('Are you sure that you wish to permanently delete ALL Twitter lists and data?');" OnClick="btnDelete_Click" Text="Delete" id="btnDelete"/>
							</Template_control>
						</wssuc:InputFormControl>	
					</template_inputformcontrols>
                </wssuc:InputFormSection>
            </td>
        </tr>
        </asp:PlaceHolder>
        <tr>
            <td>
                <wssuc:InputFormSection Title="About" runat="server">
                    <template_description>						
					</template_description>
                    <template_inputformcontrols>
						<wssuc:InputFormControl runat="server">
							<Template_control>
                                <a href="javascript:void(0);" class="ms-cui-ctl-medium" onclick="javascript:showCredits();">About and Credits</a>
							</Template_control>
						</wssuc:InputFormControl>						
					</template_inputformcontrols>
                </wssuc:InputFormSection>
            </td>
        </tr>
    </table>
    <!-- Buttons -->
    <wssuc:ButtonSection runat="server">
        <template_buttons>
			  <asp:Button UseSubmitBehavior="false" runat="server" class="ms-ButtonHeightWidth" AccessKey="<%$Resources:wss,okbutton_accesskey%>" OnClick="btnOK_Click" Text="<%$Resources:wss,multipages_okbutton_text%>" id="btnOK"/>
		</template_buttons>
    </wssuc:ButtonSection>
</asp:Content>
